var sum = 0
var num = 1
var fun = function(){
    try{
        if(parseInt(sum) >= 10000){
            console.log(sum, num)
            return 
        }
        sum += 1000 / num
        fun(num+= 1)
    }catch(e){
        console.error('内存溢出')
        console.log(sum, num)
    }
}

fun()


